package org.clockworkmages.games.anno1186.situations.gameoptions;

import org.clockworkmages.games.anno1186.GameStateService;
import org.clockworkmages.games.anno1186.Injected;
import org.clockworkmages.games.anno1186.model.option.GoBackOption;
import org.clockworkmages.games.anno1186.model.situation.Situation;
import org.clockworkmages.games.anno1186.situations.gameoptions.options.LoadGameOption;
import org.clockworkmages.games.anno1186.situations.gameoptions.options.NewGameOption;
import org.clockworkmages.games.anno1186.situations.gameoptions.options.QuitGameOption;

public class GameMenuSituation
		extends Situation {

	public static final String ID = "ST_GAME_MENU";

	public static final GameMenuSituation INSTANCE = new GameMenuSituation();
	@Injected
	private GameStateService gameStateService;

	private GameMenuSituation() {
		super(ID);
	}

	@Override
	public void update() {
		super.update();
		getOptions().clear();
		if (gameStateService.getGameState().getSituationStack().size() > 1) {
			getOptions().add(GoBackOption.INSTANCE);
		}
		getOptions().add(new NewGameOption());
		getOptions().add(new LoadGameOption());
		getOptions().add(new QuitGameOption());
	}
}
